package com.ruoyi.fantasy.service.impl;

import java.util.List;

import com.huanzhidadi.fantasy.bean.domain.FantasyNpcTalk;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.fantasy.mapper.FantasyNpcTalkMapper;
import com.ruoyi.fantasy.service.IFantasyNpcTalkService;
import com.ruoyi.common.core.text.Convert;

import javax.annotation.Resource;

/**
 * fantasynpc语句Service业务层处理
 * 
 * @author wanghui
 * @date 2020-10-16
 */
@Service
public class FantasyNpcTalkServiceImpl implements IFantasyNpcTalkService {
    @Resource
    private FantasyNpcTalkMapper fantasyNpcTalkMapper;

    /**
     * 查询fantasynpc语句
     * 
     * @param id fantasynpc语句ID
     * @return fantasynpc语句
     */
    @Override
    public FantasyNpcTalk selectFantasyNpcTalkById(String id)
    {
        return fantasyNpcTalkMapper.selectFantasyNpcTalkById(id);
    }

    /**
     * 查询fantasynpc语句列表
     * 
     * @param fantasyNpcTalk fantasynpc语句
     * @return fantasynpc语句
     */
    @Override
    public List<FantasyNpcTalk> selectFantasyNpcTalkList(FantasyNpcTalk fantasyNpcTalk)
    {
        return fantasyNpcTalkMapper.selectFantasyNpcTalkList(fantasyNpcTalk);
    }

    /**
     * 新增fantasynpc语句
     * 
     * @param fantasyNpcTalk fantasynpc语句
     * @return 结果
     */
    @Override
    public int insertFantasyNpcTalk(FantasyNpcTalk fantasyNpcTalk)
    {
        fantasyNpcTalk.setCreateTime(DateUtils.getNowDate());
        return fantasyNpcTalkMapper.insertFantasyNpcTalk(fantasyNpcTalk);
    }

    /**
     * 修改fantasynpc语句
     * 
     * @param fantasyNpcTalk fantasynpc语句
     * @return 结果
     */
    @Override
    public int updateFantasyNpcTalk(FantasyNpcTalk fantasyNpcTalk)
    {
        fantasyNpcTalk.setUpdateTime(DateUtils.getNowDate());
        return fantasyNpcTalkMapper.updateFantasyNpcTalk(fantasyNpcTalk);
    }

    /**
     * 删除fantasynpc语句对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFantasyNpcTalkByIds(String ids)
    {
        return fantasyNpcTalkMapper.deleteFantasyNpcTalkByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除fantasynpc语句信息
     * 
     * @param id fantasynpc语句ID
     * @return 结果
     */
    @Override
    public int deleteFantasyNpcTalkById(String id)
    {
        return fantasyNpcTalkMapper.deleteFantasyNpcTalkById(id);
    }
}
